package indi.jp.project.business.jingying.service;

import indi.jp.project.business.jingying.pojo.dto.BidsDTO;
import indi.jp.project.business.jingying.pojo.dto.BidsResultDTO;
import indi.jp.project.business.jingying.pojo.query.BidsQuery;
import indi.jp.project.core.entity.JsonResult;
import indi.jp.project.core.entity.po.AttachmentPO;
import indi.jp.project.process.service.FlowTaskNotifyService;

import java.util.List;

/**
 * 投标Service
 *
 * @author jiangping
 * @date 2022/5/13
 */
public interface BidsService extends FlowTaskNotifyService {

    JsonResult queryGrid(BidsQuery query) throws Exception;

    JsonResult save(BidsDTO bidsDTO) throws Exception;

    JsonResult findVoById(String id, String type) throws Exception;

    JsonResult deleteById(String id) throws Exception;

    JsonResult querySubGrid(BidsQuery query) throws Exception;

    /**
     * 创建人从主单据发起流程
     * 只有新建状态的单据可以发起
     * 发起后改变主单据状态为流程中
     * 发起后将子任务状态推给标书负责人
     */
    JsonResult initiated(String id, String lander) throws Exception;

    List<AttachmentPO> queryAttachments(String sId, String type) throws Exception;

    JsonResult saveFile(AttachmentPO attachmentPO, String type) throws Exception;

    JsonResult deleteFile(String id) throws Exception;

    /**
     * 保存中标结果
     */
    JsonResult saveResult(BidsResultDTO bidsResultDTO, String lander) throws Exception;

    /**
     * 确认中标结果
     */
    JsonResult confirmResult(BidsResultDTO bidsResultDTO, String lander) throws Exception;
}
